package net.vinote.smart.platform.timer;

import java.util.logging.Level;

import net.vinote.smart.platform.module.log.RunLogger;

/**
 * 服务器定时任务
 * 
 * @author Seer
 *
 */
public abstract class AbstractSmartTimerTask extends TimerTask {
	private static Timer timer = new Timer("Smart Timer", true);
	private long delay;

	public void schedule() {
		RunLogger.getLogger().log(Level.SEVERE,
				"Regist SmartTimerTask---- " + this.getClass().getSimpleName());
		if (period > 0) {
			timer.schedule(this, delay, period, terminalTime);
		} else {
			timer.schedule(this, delay, terminalTime);
		}
	}

	void setDelay(long delay) {
		this.delay = delay;
	}

}
